package com.haina.shop.mapper;

import com.github.pagehelper.Page;
import com.haina.shop.domain.ProdComm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.haina.shop.dto.CommPageDTO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 48077
* @description 针对表【tz_prod_comm(商品评论)】的数据库操作Mapper
* @createDate 2024-07-31 18:34:29
* @Entity com.haina.shop.domain.ProdComm
*/
public interface ProdCommMapper extends BaseMapper<ProdComm> {
@Select("select count(*) from tz_prod_comm where prod_id =#{prodId}")
    int  selectCountByProdId(Long prodId);
@Select("select count(*) from tz_prod_comm where prod_id =#{prodId} and evaluate=0")
    int  selectGoodNumberById(Long prodId);
    @Select("select count(*) from tz_prod_comm where prod_id =#{prodId} and evaluate=1")
    int selectMinNumberById(Long prodId);
    @Select("select count(*) from tz_prod_comm where prod_id =#{prodId} and evaluate=2")
    int selectBadNumberById(Long prodId);
    @Select("select count(*) from tz_prod_comm where prod_id =#{prodId} and  pics = ''")
    int priceNumber(Long prodId);




    Page<ProdComm> getPage(CommPageDTO commPageDTO);
}




